$(function () {
  // console.log($)
  // console.log(Zepto)

  $('main').on('click', '.zan p:first-child',function () {
    // console.log($(this).children('img').attr('data-zan'))
    const $img = $(this).children('img')
    let isZan = $img.data('zan')
    let zanCount = +$img.next().html()
    if (+isZan === 1) {
      $img.attr('src', './pic/state-thumbs-up.svg')
        .data('zan', 0)
        .next().html(zanCount - 1)
    } else {
      $img.attr('src', './pic/hearts.svg')
        .data('zan', 1)
        .next().html(zanCount + 1)
    }
  })



})


